package com.zr.serviceimpl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zr.dao.CarDaoZYH;
import com.zr.service.CarServiceZYH;

import net.sf.json.JSONArray;

@Service("CarServiceZYH")
public class CarServiceImplZYH implements CarServiceZYH {
	// 属性注入
	@Resource
	private CarDaoZYH cardao;
	
	@Transactional
	@Override
	public JSONArray getCarInfo(int page,int rows) {
		// TODO Auto-generated method stub
		return cardao.getCarInfo(page,rows);
	}

	@Override
	public void insertCar(String carName, String carType,String carNumber , int carMaxWeight, String carState,int dpId) {
		// TODO Auto-generated method stub
		cardao.insertCar(carName, carType, carNumber , carMaxWeight, carState, dpId);
		
	}

	@Override
	public long findCarCount() {
		// TODO Auto-generated method stub
		return cardao.findCarCount();
	}

	@Override
	public JSONArray getDpidAndDpname() {
		// TODO Auto-generated method stub
		return cardao.getDpidAndDpname();
	}

	@Override
	public boolean updateDpByCarId(int carId, String dpName) {
		// TODO Auto-generated method stub
		return cardao.updateDpByCarId(carId, dpName);
	}

	@Override
	public int findDpIdByDpName(String DpName) {
		// TODO Auto-generated method stub
		return cardao.findDpIdByDpName(DpName);
	}

	@Override
	public int findCarNumber(String carNum) {
		// TODO Auto-generated method stub
		return cardao.findCarNumber(carNum);
	}

}
